<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <title>title</title>
</head>

<body>
    <h1 id="demo">spy</h1>
    <button type="button" onclick="hide()">隐</button>
    <button type="button" onclick="appear()">现</button>
    <script>
        function hide() {
            document.getElementById("demo").style.display = "none"
        }

        function appear() {
            document.getElementById("demo").style.display = "block"
        }
    </script>
</body>

</html>